#include "./../../include/online/Server/SearchEngineServer.h"
#include "./../../include/online/Tools/Configuration.h"
#include <iostream>
#include <string>
#include <map>

using namespace std;

extern __thread const char *name;

void test()
{
    Configuration::getInstance()->readConfigFile("/home/yuan/Project/SearchEngine/conf/searchEngine.conf");

    unordered_map<string, string> configMap = Configuration::getInstance()->getConfigMap();
    
    size_t threadNums = std::stoull(configMap["threadNums"]);
    size_t taskQueueSize = std::stoull(configMap["TaskQueSize"]);
    std::string serverIP = configMap["server_ip"];
    uint16_t serverPort = static_cast<uint16_t>(std::stoul(configMap["server_port"]));

    SearchEngineServer server(threadNums,taskQueueSize,serverIP,serverPort);
    server.start();
}
int main()
{
    test();
    return 0;
}
